/******************************************************************************/
//	Actor.h	-	A basic character
//
//	Author:		Russell Klinkerman
//	Created:	01.18.2004
/******************************************************************************/

#ifndef _ACTOR_H_
#define _ACTOR_H_

#include "ObjectBase.h"
#include "FSM.h"

#include "Direct3DManager.h"

#include "DxImage.h"
#include "DxAnim2D.h"
#include "DxChart.h"

#include <string>
using std::string;

#include <list>
using namespace std;

enum	ActorChartId
{
	CHART_IDLE = 0, CHART_BLOCK, CHART_FIGHT
};

class CActor : public CObjectBase
{
	public:

		CDxAnim2D	*	pActiveAnimation;	// a pointer to the active animation

		D3DXMATRIX		actorMatrix;	// defines positon, scale, and rotation of actor

		FSM	stateMachine;	// The actor's state machine

		CDxImage		dxiActor;	// The imageset used for this actor

		CDxAnim2D		animIdle,	// Idle Animation
						animBlock,	// Block Animation
						animFight;	// Fight Animation

		// The flowchart
		CDxChart		dxcFlow;			// Flow chart to demonstrate state changes
		CDxImage		dxiFlowBackground;	// Chart Background
		CDxImage		dxiFlowMarker;		// Chart Marker
		D3DXMATRIX		mFlow;				// position, scale, and rotation of the actor

		// Message Queue
		list< string >	messageQueue;

		friend class CStateIdle;	// Possible states for the actor must be friends, so
		friend class CStateFight;	// we can access the actor's private members from
		friend class CStateBlock;	// within the state object.

		/******************************************************************************/
		//	Init	-	Initializes Actor
		/******************************************************************************/
		void	Init();

		/******************************************************************************/
		//	Update	-	Updates Actor (input, statemachine, etc)
		//
		//	Return:	TRUE if successful
		/******************************************************************************/
		bool	Update();

		/******************************************************************************/
		//	LoadScript	-	Populates actor's FSM as defined by script
		//
		//	In:		_szScriptFile	-	the filename of the actor's FSM Script
		/******************************************************************************/
		void	LoadScript(char * _szScriptFile);

		/******************************************************************************/
		//	Draw	-	Draws the actor to the backbuffer
		/******************************************************************************/
		void	Draw();

		/******************************************************************************/
		//	Shutdown	-	Performs necessary shutdown for the actor
		/******************************************************************************/
		void	Shutdown();
};

#endif